<div class="popupdiv" id="country_container">
{literal}
<div style="font-size: 12px; margin-bottom: 5px;">
[<a href="javascript:void(0);" style="text-decoration: underline;" onclick="$$('#country_container input').each(function (item) { item.checked = true; }); return false">отметить все</a>]
[<a href="javascript:void(0);" style="text-decoration: underline;" onclick="$$('#country_container input').each(function (item) { item.checked = false; }); return false">убрать все отметки</a>]
</div>
{/literal}
{foreach item=country from=$Countries}
<div style="width: 200px; float: left;">
    <input type="checkbox" name="selectedCountries[]" value="{$country->getPk()}" id="selectedCountries_{$country->getPk()}" {if in_array($country->getPk(), $selectedCountries)}checked="checked"{/if}>
    <label for="selectedCountries_{$country->getPk()}" id="l_selectedCountries_{$country->getPk()}">{$country.name}</label>
</div>
{/foreach}
</div>